Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions / Editing Shape Geometries


GXGetPathParts

You can use the GXGetPathParts function to extract a copy of a specified range of geometric points from the geometry of a path shape and put these points into a gxPaths structure.

long GXGetPathParts(gxShape source, long index, long count, 
                    gxPaths *data);
source
A reference to the path shape containing the desired geometric points.
index
The geometry index of the first geometric point to copy.
count
The number of geometric points to copy. You may provide the gxSelectToEnd constant for this parameter.
data
A pointer to a gxPaths structure. On return, this structure contains the copied geometric information.
function result
The number of bytes required to hold the information returned in the data parameter.
DESCRIPTION
The GXGetPathParts function copies geometry information from the source path shape into the gxPaths structure specified by the data parameter. This function copies all of the geometry information starting with the geometric point indicated by the index parameter and continuing for as many geometric points as indicated by the count parameter. This function copies the values of the indicated geometric points and retains the information about contour breaks from the original geometry, as well as the information about which points are on curve and which are off curve. The function result is the length in bytes of the information returned in the data parameter.

Both the index and the count parameters must be greater than 0, although you can provide the gxSelectToEnd constant for the count parameter, which indicates that you want a copy of all the geometric points starting with the geometric point indicated by the index parameter.

You may pass nil for the data parameter. In this case, the function still returns the byte length as the function result, but does not copy any geometry information.

Typically, to use this function, you go through these steps:

  1. Determine the byte length needed to store the copied geometry information by calling this function, passing nil for the data parameter.
  2. Allocate enough memory to hold the copied geometry information.
  3. Call this function again, passing a pointer to the allocated memory in the data parameter.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
illegal_type_for_shape(debugging version)
index_is_less_than_one(debugging version)
count_is_less_than_one(debugging version)
Warnings 
index_out_of_range 
count_out_of_range 
SEE ALSO
For a discussion of paths, see "Path Shapes" on page 2-25.

For the definition of the gxPaths structure, see page 2-107.

For information about other functions that allow you to extract information from shape geometries, see the description of the GXGetShapePoints function on page 2-140 and the description of the GXGetShapeParts function on page 2-152.

To replace parts of a path shape's geometry, use the GXSetPathParts function, which is described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help